Component({
  properties: {
    active: {
      type: Number,
      value: null
    }
  },
  data: {
    list: [
      "/pages/index/index",
      "/pages/workOrderList/workOrderList",
      "/pages/mine/mine"
    ]
  },
  methods: {
    changePage(e) {
      const currentIndex = e.detail;

      // 向外通知变化
      this.triggerEvent('change', {
        detail: currentIndex
      });

      // 页面跳转
      wx.redirectTo({
        url: this.data.list[currentIndex],
        fail: (err) => {
          console.log(err);
        }
      });
    }
  }
});